import { throttle } from "@/utils";

// pc h5切换
export const useWindowSize = () => {

    const setSize = () => {
        const deviceWidth = document.documentElement.clientWidth;
        const standardWidth = 375;
        const fontSize = (deviceWidth * 1) / standardWidth + "px";
        document.documentElement.style.fontSize = fontSize;
    };
    onMounted(() => {
        setSize();
        window.addEventListener("resize", throttle(setSize, 0.2));
    });
}